package com.ly.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.system.mapper.UserWorkExperienceMapper;
import com.ly.system.service.IUserWorkExperienceService;
import org.springframework.stereotype.Service;
import com.ly.common.core.domain.entity.UserWorkExperienceEntity;

import javax.annotation.Resource;

/**
 * 用户工作经历Service业务层处理
 * @author wutao
 * @date 2024-05-29
 */
@Service
public class UserWorkExperienceServiceImpl extends ServiceImpl<UserWorkExperienceMapper, UserWorkExperienceEntity> implements IUserWorkExperienceService {

    @Resource
    private UserWorkExperienceMapper userWorkExperienceEntityMapper;

    /**
     * 查询用户工作经历
     * @param id 用户工作经历ID
     * @return 用户工作经历
     */
    @Override
    public UserWorkExperienceEntity selectUserWorkExperienceEntityById (String id) {
        return userWorkExperienceEntityMapper.selectUserWorkExperienceEntityById ( id );
    }

    /**
     * 查询用户工作经历列表
     * @param userWorkExperienceEntity 用户工作经历
     * @return 用户工作经历
     */
    @Override
    public List<UserWorkExperienceEntity> selectUserWorkExperienceEntityList (UserWorkExperienceEntity userWorkExperienceEntity) {
        return userWorkExperienceEntityMapper.selectUserWorkExperienceEntityList ( userWorkExperienceEntity );
    }

    /**
     * 新增用户工作经历
     * @param userWorkExperienceEntity 用户工作经历
     * @return 结果
     */
    @Override
    public int insertUserWorkExperienceEntity (UserWorkExperienceEntity userWorkExperienceEntity) {
        userWorkExperienceEntity.setCreateTime ( DateUtils.getNowDate () );
        return userWorkExperienceEntityMapper.insertUserWorkExperienceEntity ( userWorkExperienceEntity );
    }

    /**
     * 修改用户工作经历
     * @param userWorkExperienceEntity 用户工作经历
     * @return 结果
     */
    @Override
    public int updateUserWorkExperienceEntity (UserWorkExperienceEntity userWorkExperienceEntity) {
        userWorkExperienceEntity.setUpdateTime ( DateUtils.getNowDate () );
        return userWorkExperienceEntityMapper.updateUserWorkExperienceEntity ( userWorkExperienceEntity );
    }

    /**
     * 批量删除用户工作经历
     * @param ids 需要删除的用户工作经历ID
     * @return 结果
     */
    @Override
    public int deleteUserWorkExperienceEntityByIds (String[] ids) {
        return userWorkExperienceEntityMapper.deleteUserWorkExperienceEntityByIds ( ids );
    }

    /**
     * 删除用户工作经历信息
     * @param id 用户工作经历ID
     * @return 结果
     */
    @Override
    public int deleteUserWorkExperienceEntityById (String id) {
        return userWorkExperienceEntityMapper.deleteUserWorkExperienceEntityById ( id );
    }
}
